Skip to content

Share links for long projects (#project= beyond GitHub Pages' limit) - #14

Merged
cedricvogel-leo merged 1 commit into
mainfrom
feature/share-long-projects
Oct 25, 2026
Merged

cedricvogel-leo merged 1 commit into
mainfrom
feature/share-long-projects

Conversation

@cedricvogel-leo

Copy link
Copy Markdown
Collaborator

Prepares P17 («In IDE öffnen» in the LiaScript macro), which builds IDE links in this format. Merge this first.

Problem. GitHub Pages answers 414 URI Too Long when a request's path and query exceed 8192 characters (measured against glpython-edu.github.io; 8192 works, 8193 doesn't). A share link carries the whole project in ?project=, so a long project's link didn't open at all. With realistic code that is roughly 5,000–30,000 characters of program, depending on how well lz-string compresses it.

Change (src/projectShare.ts)

  • buildShareUrl keeps ?project= while the link fits. Beyond the limit it puts the same encoded payload in the fragment, #project=…, which the browser never sends to the server.
  • On load, the IDE reads the project from the query or the fragment, and removes it from the address bar as before.
  • Existing ?project= links are unchanged.

Tested with npm run preview, each link opened in a fresh browser profile and run:

Program Link Result
858 chars 720 chars, ?project= runs
17,585 chars 5,261 chars, ?project= runs
145,862 chars 33,763 chars, #project= runs

In each case the address bar is clean afterwards. Build and lint pass, with the same warnings as main.

🤖 Generated with Claude Code

GitHub Pages answers 414 when a request's path and query exceed 8192
characters, so a share link of a long project didn't open. Such a link
now carries the project as #project=... (never sent to the server); the
IDE reads it from either place. Links that fit keep ?project=.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cedricvogel-leo
cedricvogel-leo merged commit ee8c5a5 into main Oct 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant